package com.yqg.manage.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.manage.common.ListInteger2ListLongTypeHandler;
import com.yqg.manage.controller.dto.FileDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

/**
 * case 实体类
 *
 * @author suzhuang
 * @since 2023-07-05
 */
@Getter
@Setter
@ApiModel(value = "Case对象", description = "")
@TableName("cases")
public class Case implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("案件编号")
    private String caseNo;

    @ApiModelProperty("案件名称")
    private String caseName;

    @ApiModelProperty("卷宗编号")
    private Long dossierId;

    @ApiModelProperty("案件来源")
    private Long informSourceId;

    @ApiModelProperty("案件分类")
    private Long caseTypeId;

    @ApiModelProperty("违法类型")
    private String illegalType;

    @ApiModelProperty("案件说明")
    private String explains;

    @ApiModelProperty("录入时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime enterTime;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("承办人")
    private Long transactor;

    @ApiModelProperty("承办人审核说明")
    private String transactorExplain;

    @ApiModelProperty("中队长ID")
    private Long squadronLeader;

    @ApiModelProperty("科室审核说明")
    private String squadronLeaderExplain;

    @ApiModelProperty("法规科ID")
    private Long lawDepartment;

    @ApiModelProperty("法规科审核说明")
    private String lawDepartmentExplain;

    @ApiModelProperty("局长ID")
    private Long director;

    @ApiModelProperty("局长审核说明")
    private String directorExplain;

    @ApiModelProperty("服务中心ID")
    private Long service;

    @ApiModelProperty("服务中心审核说明")
    private String serviceExplain;

    @ApiModelProperty("领导ID")
    private Long leader;

    @ApiModelProperty("是否办理（2已办理，1办理中，0待办理）")
    private String isHanding;

    @ApiModelProperty("办理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime dealCreate;

    /**
     * 0：未提交，1：科室待审核，2：科室未通过，3：法规科待审核，4：法规科未通过，5：部门待审核，6：部门未通过，7：服务中心待审核
     * 8：服务中心未通过，9：领导待审批，10：领导未通过，11：领导通过
     */
    @ApiModelProperty("案件阶段")
    private String process;

    @ApiModelProperty("驳回原因")
    private String backReason;

    @ApiModelProperty("案件节点id")
    private Long archiveNodeId;

    @ApiModelProperty("程序类型 1简易程序 2普通程序 3听证程序 4强制程序")
    private Long routineTypeId;

    @ApiModelProperty("案件流程节点id")
    @TableField(value = "archive_branch_node_ids",
            typeHandler = ListInteger2ListLongTypeHandler.class,
            updateStrategy = FieldStrategy.IGNORED)
    private List<Long> archiveBranchNodeIds;

    @ApiModelProperty("是否可用（0可用1不可用）")
    private String isDelete;

    /**
     * 案件所属部门ID
     */
    @TableField(exist = false)
    private Long unitId;
    /**
     * 案件所属部门名称
     */
    @TableField(exist = false)
    private String unitName;

    @TableField(exist = false)
    private String dossierName;

    @TableField(exist = false)
    private String informName;

    @TableField(exist = false)
    private String routineType;

    @TableField(exist = false)
    private String typeName;
    /**
     * 承办人姓名
     */
    @TableField(exist = false)
    private String transactorName;
    /**
     * 中队长姓名
     */
    @TableField(exist = false)
    private String squadronLeaderName;
    /**
     * 法规科姓名
     */
    @TableField(exist = false)
    private String lawDepartmentName;
    /**
     * 局长姓名
     */
    @TableField(exist = false)
    private String directorName;
    /**
     * 服务中心姓名
     */
    @TableField(exist = false)
    private String serviceName;
    /**
     * 领导姓名
     */
    @TableField(exist = false)
    private String leaderName;

    @TableField(exist = false)
    private List<FileDTO> annex;
}
